<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
		<html>
		<head>
		<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
		<title>Image</title>
		<META HTTP-EQUIV="EXPIRES" CONTENT=0>
		<link rel="stylesheet" href="../../../../docs.css">
		</head>
		<body>
		
<br>
<h1>Io Reference</h1>
<br><br><br>
<br><br><br>
<a class='column' href='../../index.html'>Graphics</a>
&nbsp;&nbsp;<font color=#ccc>/</font>&nbsp;&nbsp;
<a class='column' href='../index.html'>Image</a>
&nbsp;&nbsp;<font color=#ccc>/</font>&nbsp;&nbsp;
<b>Image</b>
<br><br><br>
<br><br><br>
<table border=0 cellspacing=0 style="margin-left:8em; width:40em; line-height:1.2em;">
<tr>
<td align=right></td>
<td></td>
<td>The Image object can read and draw images and provide the image 
data as a buffer. Example use:
<pre>	
image = Image clone open("curly.png")
image draw
image scaleTo(image width / 2, image height / 2)
image save("curly.tiff")
</pre>	
When loading an attempt will be made to convert the image into whichever 
of the following formats it is closest to: L8, LA8, RGB8, RGBA8.
<p>
Currently supported formats include PNG(which supports alpha), JPG and TIFF.
</td></tr>
<tr><td colspan=3>&nbsp;</td></tr>
<tr><td colspan=3>&nbsp;</td></tr>
<tr><td colspan=3>&nbsp;</td></tr>
<tr>
<td align=right>
</td>
<td></td>
<td>
<hr align=left color=#ddd height=1>
<br><br>
<a name="Image-addAlpha"></a><b>
addAlpha
</b>
<p>
<div class=slotDescription>
Adds an opaque alpha component if the image is in RGB format and does not already contain one.  Returns self.
</div>
<a name="Image-averageColor"></a><b>
averageColor
</b>
<p>
<div class=slotDescription>
Returns the average RGB color of all pixels in the image.
</div>
<a name="Image-baselineHeight"></a><b>
baselineHeight
</b>
<p>
<div class=slotDescription>
Returns the pixel height (relative to the bottom of the image) which first contains a non-white pixel or -1 if
	no baseline is found.
</div>
<a name="Image-bitPlain"></a><b>
bitPlain(component, bit)
</b>
<p>
<div class=slotDescription>
Replaces contents with black-and-white image where white appears if and only if specified component contained 1 on the specified bit plain.
	Returns self.
</div>
<a name="Image-bounds"></a><b>
bounds(cutoff)
</b>
<p>
<div class=slotDescription>
Returns an object continaing the bounds of the image. Cutoff is max bound color value for any color component.
	If it is negative, it is the min bound color value.
</div>
<a name="Image-componentCount"></a><b>
componentCount
</b>
<p>
<div class=slotDescription>
Returns the number of color components in the receiver as a Number.
</div>
<a name="Image-componentPlain"></a><b>
componentPlain(component)
</b>
<p>
<div class=slotDescription>
Removes other components except specified from the image.
	Returns self.
</div>
<a name="Image-crop"></a><b>
crop(x, y, width, height)
</b>
<p>
<div class=slotDescription>
Crops the image to the specified values. Returns self.
	Raises an exception on error.
</div>
<a name="Image-data"></a><b>
data
</b>
<p>
<div class=slotDescription>
Returns a Buffer primitive containing the image data (loading it first if needed). 
	Manipulating this data will affect what is drawn when the receiver's draw method is called.
</div>
<a name="Image-decodingHeightHint"></a><b>
decodingHeightHint
</b>
<p>
<div class=slotDescription>
Returns the decoding height hint.
</div>
<a name="Image-decodingWidthHint"></a><b>
decodingWidthHint
</b>
<p>
<div class=slotDescription>
Returns the decoding width hint.
</div>
<a name="Image-encodingQuality"></a><b>
encodingQuality
</b>
<p>
<div class=slotDescription>
Returns the encodingQuality setting.
</div>
<a name="Image-equalizeHistogram"></a><b>
equalizeHistogram(mode)
</b>
<p>
<div class=slotDescription>
Performs histogram equalization. Mode denotes quality factor and processing speed. Mode should be in range [0..3].
	Returns self.
</div>
<a name="Image-error"></a><b>
error
</b>
<p>
<div class=slotDescription>
Returns a String containing the current error or nil if there is no error.
</div>
<a name="Image-filterGauss"></a><b>
filterGauss(sigma)
</b>
<p>
<div class=slotDescription>
Returns new image as a result of applying filter. Implements Gauss smoothing filtering with parameter sigma.
</div>
<a name="Image-filterKirsch"></a><b>
filterKirsch(a)
</b>
<p>
<div class=slotDescription>
Returns new image as a result of applying Kirsch filter.
	The argument denotes direction: 0, 1, 2, ... -> 0, pi / 4, pi / 2, ...
</div>
<a name="Image-filterLinear"></a><b>
filterLinear(filterSizeX, filterSizeY, filter)
</b>
<p>
<div class=slotDescription>
Returns new image as a result of applying filter.
</div>
<a name="Image-filterMax"></a><b>
filterMax(filterSizeX, filterSizeY)
</b>
<p>
<div class=slotDescription>
Returns new image as a result of applying filter.
</div>
<a name="Image-filterMedian"></a><b>
filterMedian(filterSizeX, filterSizeY)
</b>
<p>
<div class=slotDescription>
Returns new image as a result of applying filter.
</div>
<a name="Image-filterMin"></a><b>
filterMin(filterSizeX, filterSizeY)
</b>
<p>
<div class=slotDescription>
Returns new image as a result of applying filter.
</div>
<a name="Image-filterNonlinearGradients"></a><b>
filterNonlinearGradients
</b>
<p>
<div class=slotDescription>
Returns new image as a result of applying filter. Calculates abs(f'x) + abs(f'y).
</div>
<a name="Image-filterSobel"></a><b>
filterSobel(a)
</b>
<p>
<div class=slotDescription>
Returns new image as a result of applying Sobel filter.
	The argument denotes direction: 0, 1, 2, ... -> 0, pi / 4, pi / 2, ...
</div>
<a name="Image-filterUniformAverage"></a><b>
filterUniformAverage(filterSizeX, filterSizeY)
</b>
<p>
<div class=slotDescription>
Returns new image as a result of applying filter. Implements low pass filtering.
</div>
<a name="Image-filterUnsharpMask"></a><b>
filterUnsharpMask(a)
</b>
<p>
<div class=slotDescription>
Returns new image as a result of applying filter. Implements unsharp mask filtering. 
	The result is sharpened image.
	The parameter value may by any but it makes sense if it is > 0.
</div>
<a name="Image-filterWeightedMedian"></a><b>
filterWeightedMedian(filterSizeX, filterSizeY, filter)
</b>
<p>
<div class=slotDescription>
Returns new image as a result of applying filter.
</div>
<a name="Image-flipX"></a><b>
flipX
</b>
<p>
<div class=slotDescription>
Flips the image on the horizonal plane (left/right mirror). Returns self.
</div>
<a name="Image-flipY"></a><b>
flipY
</b>
<p>
<div class=slotDescription>
Flips the image on the vertical plane (top/bottom mirror). Returns self.
</div>
<a name="Image-height"></a><b>
height
</b>
<p>
<div class=slotDescription>
Returns the image hieght.
</div>
<a name="Image-histogram"></a><b>
histogram
</b>
<p>
<div class=slotDescription>
Returns array with histogram values interleaved by channels.
</div>
<a name="Image-isL8"></a><b>
isL8
</b>
<p>
<div class=slotDescription>
Returns true if the receiver is in L8 (8bit Luminance) format, false otherwise.
</div>
<a name="Image-isLA8"></a><b>
isLA8
</b>
<p>
<div class=slotDescription>
Returns true if the receiver is in LA8 (8bit Luminance-Alpha) format, false otherwise.
</div>
<a name="Image-isRGB8"></a><b>
isRGB8
</b>
<p>
<div class=slotDescription>
Returns true if the receiver is in RGB8 format, false otherwise.
</div>
<a name="Image-isRGBA8"></a><b>
isRGBA8
</b>
<p>
<div class=slotDescription>
Returns true if the receiver is in RGBA8 format, false otherwise.
</div>
<a name="Image-linearContrast"></a><b>
linearContrast
</b>
<p>
<div class=slotDescription>
Performs contrast linarization. Per-pixel per-channel transformation that extends intensity to its full range.
	Returns self.
</div>
<a name="Image-makeGrayscale"></a><b>
makeGrayscale
</b>
<p>
<div class=slotDescription>
Converts color model to Luminance or Luminance-Alpha 8bit (grayscale). Returns self.
</div>
<a name="Image-makeL8"></a><b>
makeL8
</b>
<p>
<div class=slotDescription>
Converts color model to Luminance 8bit (grayscale). Returns self.
</div>
<a name="Image-makeRGBA8"></a><b>
makeRGBA8
</b>
<p>
<div class=slotDescription>
Converts color model to RGBA 8bit. Returns self.
</div>
<a name="Image-open"></a><b>
open(optionalPathString)
</b>
<p>
<div class=slotDescription>
Sets the path to optionalPathString if provided and opens the image file. 
	Returns self on success, Nil on failure.
</div>
<a name="Image-path"></a><b>
path
</b>
<p>
<div class=slotDescription>
Returns the image path.
</div>
<a name="Image-removeAlpha"></a><b>
removeAlpha
</b>
<p>
<div class=slotDescription>
Removes the alpha component if the image contains one.  Returns self.
</div>
<a name="Image-resizedTo"></a><b>
resizedTo(newWidth, newHeight)
</b>
<p>
<div class=slotDescription>
Scales the image up to newWidth x newHeight.  Returns the newly scaled image.
</div>
<a name="Image-resizedTo"></a><b>
resizedTo(width, height)
</b>
<p>
<div class=slotDescription>
Returns a new image of the receiver resized to the given width and height.
	Raises an exception on error.
</div>
<a name="Image-save"></a><b>
save(optionalPathString)
</b>
<p>
<div class=slotDescription>
Sets the path to optionalPathString if provided and saves the image 
	in the format specified by the path extension. Returns self on success, nil on failure.
</div>
<a name="Image-setDataWidthHeightComponentCount"></a><b>
setDataWidthHeightComponentCount(aSequence, width, height, componentCount)
</b>
<p>
<div class=slotDescription>
Sets the image data and its parameters. Returns self.
</div>
<a name="Image-setDecodingHeightHint"></a><b>
setDecodingHeightHint(width)
</b>
<p>
<div class=slotDescription>
Sets the decoding height hint. Returns self.
</div>
<a name="Image-setDecodingWidthHint"></a><b>
setDecodingWidthHint(width)
</b>
<p>
<div class=slotDescription>
Sets the decoding width hint. Returns self.
</div>
<a name="Image-setEncodingQuality"></a><b>
setEncodingQuality(aNumber)
</b>
<p>
<div class=slotDescription>
Sets the image encoding quality (range is 0.0 - 1.0, 1.0 with being the highest).
</div>
<a name="Image-setPath"></a><b>
setPath(aString)
</b>
<p>
<div class=slotDescription>
Sets the image path. Returns self.
</div>
<a name="Image-thresholdByGradient"></a><b>
thresholdByGradient
</b>
<p>
<div class=slotDescription>
Performs thresholding. Threshold value is finded using Otsu's method.
	Returns self.
</div>
<a name="Image-width"></a><b>
width
</b>
<p>
<div class=slotDescription>
Returns the image width.
</div>
</td>
</tr>
</table>
<br><br><br><br><br>
</body>
</html>
